Welcome Guest | Sign in | Register

Home > C Programming > printf() and scanf() > Questions and Answers

01. What will be the output of the following program?
main()
{
printf(â??%câ??,â??Gyantonicâ??[4]);
}  
A. G B. n
C. t D. none of these

Answer and Explanation

Answer: t

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
02. What is the output of following program?
void main(){
int a;
float f;
a=12/5;
f=12/5;
printf("%d%f",a,f);
}
A. 2,2.000000 B. 2,2.00
C. 2,2 D. none of these

Answer and Explanation

Answer: 2,2.000000

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
03. What is the output of following program?
main(){
auto a;
register r;
static s;
extern e;
printf("%d",sizeof a);
printf("%d",sizeof r);
printf("%d",sizeof s);
printf("%d",sizeof e);
return 0;

A. 2 4 2 4 B. 2 2 4 2
C. 2 2 2 2 D. 2 4 2 2

Answer and Explanation

Answer: 2 2 2 2

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
04. What is the output of following program?
main(){
int a,b;
a=b=100;
scanf("%d%d",a,&b);
//Entered Values are 40 85
printf("%d %d",a,b);

A. 40 85 B. 0 85
C. 100 85 D. 100 100

Answer and Explanation

Answer: 100 85

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
05. What is the output of the following program?
void main(){
int a;
a=100>90>80;
printf("%d",a);
}  
A. 0 B. 1
C. error D. none of these

Answer and Explanation

Answer: 0

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
06. What will be the output of the following program?
void main( ){
int a=10;
printf("%d",a);
{
int a=20;
printf("%d",a);
}
printf("%d",a);
}   
A. 10 10 B. 20 10
C. 10 20 10 D. 10 10 10

Answer and Explanation

Answer: 10 20 10

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
07. What will be output of the following program?
#include
int main(){
int x;
x=10,20,30;
printf("%d",x);
return 0;

A. 10 B. 20
C. 30 D. 0

Answer and Explanation

Answer: 10

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
08. What is the output of following program?
void main(){
int a;
a='a'>'A';
printf("%d",a);

A. 0 B. 1
C. garbage D. none of these

Answer and Explanation

Answer: 1

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
09. What is the output of following program?
void main(){
printf("1");
goto XYZ;
printf("2");
XYZ:
printf("3");
}  
A. 12 B. 23
C. 13 D. 31

Answer and Explanation

Answer: 13

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
10.  What is the output of following program?
void main(){
int a,b,c,d;
a=b=c=d=1;
a=++b>1 || ++c>1 && ++d>1;
printf("%d%d%d",a,b,c,d);
}  
A. 1 1 2 1 B. 1 2 1 1
C. 1 2 2 1 D. 1 2 1 2

Answer and Explanation

Answer: 1 2 1 1

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum
11. What is the output of following program?
main(){
int a,b;
a=b=100;
scanf("%d%d",a,&b);
//Entered Values are 40 85
printf("%d %d",a,b);

A. 40 85 B. 0 85
C. 100 85 D. 100 100

Answer and Explanation

Answer: 100 85

Explanation:
There is no explanation...

Report Errors

Name:

Loading...

VView Answer | RReport | DDiscuss in Forum



Partner Sites
LucentBlackBoard.com                  SoftLucent.com                  LucentJobs.com
All rights reserved © 2012-2015 SoftLucent.